
    <div id="container">
            <div class="user_bindSidebar">
    <dl id="user_sideBarmenu" class="user_sideBarmenu">
                <dt><h3>帐号设置</h3></dt>
                
        <dd><a class="hover" href="?r=login/show">修改密码</a></dd>
            </dl>
</div>
<input type="hidden" id="hasSidebar" value="1"> <div class="content user_modifyContent">
        <dl class="c_section">
            <dt>
                <h2><em></em>修改密码</h2>
            </dt>
            <dd>
                                <form id="updatePswForm">
                    <table class="savePassword">
                        <tbody><tr>
                            <td>登录邮箱</td>
                            <input type="hidden" name="user_name" value="<?php echo $user_name; ?>">
                            <td class="c7"><?php echo "$user_name"; ?></td>
                        </tr>
                        <tr>
                            <td class="label">当前密码</td>
                            <td>
                                <input type="password" maxlength="16" id="oldpassword" name="oldpassword" style="background-image: url(style/images/img/0CQnd2Jos49xUAAAAASUVORK5CYII=quot); background-repeat: no-repeat; background-attachment: scroll; background-position: right center;">
                                <span id="updatePwd_beError" style="display:none;" class="error">
                            </span></td>                            
                        </tr>
                        <tr>
                            <td class="label">新密码</td>
                            <td><input type="password" maxlength="16" id="newpassword" name="newpassword" style="background-image: url(style/images/img/a6y3y0Wx5kbFHvGuXzkgf0xhKnPzA4UTyaTB8Ph8AvcHi3fnsrZ7Wore02YViqVOrRXXPhfqP8j6MYlawoAAAAASUVORK5CYII=quot); background-repeat: no-repeat; background-attachment: scroll; background-position: right center;"></td>
                        </tr>
                        <tr>
                            <td class="label">确认密码</td>
                            <td><input type="password" maxlength="16" id="comfirmpassword" name="comfirmpassword" style="background-image: url(style/images/img/a6y3y0Wx5kbFHvGuXzkgf0xhKnPzA4UTyaTB8Ph8AvcHi3fnsrZ7Wore02YViqVOrRXXPhfqP8j6MYlawoAAAAASUVORK5CYII=quot); background-repeat: no-repeat; background-attachment: scroll; background-position: right center;"></td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td><input type="submit" name="sub" value="保 存"></td>
                        </tr>
                    </tbody></table>
                </form>
                            </dd>
        </dl>
    </div>
<script src="frontend/web/jquery/jquery.js"></script>
<script>
    $(function () {
        $("input[name='sub']").click(function () {
            var oldpassword=$("input[name='oldpassword']").val();
            var newpassword=$("input[name='newpassword']").val();
            var user_name=$("input[name='user_name']").val();
            $.ajax({
                type:"post",
                url:"?r=login/show",
                data:{
                    newpassword:newpassword,
                    oldpassword,oldpassword,
                    user_name,user_name
                },
                success:function (data) {
                    // alert(data);
                    if (data==1) {
                        alert("修改密码成功，请重新登录");
                        location.href="?r=login/index";
                    }else{
                        alert("修改密码失败，新旧密码一致");
                        location.href="?r=login/show";
                    }
                }
            })
        })
    })
</script>

